<?php echo View::make('backend.header');?>
<?php echo View::make('backend.nav')->with('nav', Config::get('option.nav', array()))->with('active', 'collection');?>
<div id="wrap">
  <div style='height:60px;'></div>
  <div class="container">
    <span class='label label-info'>专题列表</span>
    <a class='label label-success pull-right' href='/backend/new_collection/'>新专题</a>
    <table class='table  table-striped table-bordered'>
        <thead>
          <tr>
          <th style='width:20%;'>#ID</th>
          <th>#Collection</th>
          <th>#Description</th>
          <th>#Amount</th>
          <th style='width:10%;'>#OP</th>
          <th style='width:7%;'>#OP2</th>
          <th style='width:7%;'>#OP3</th>
          </tr>
        </thead>
        <tbody>
        <?php foreach ($collections as $c):?>
          <tr>
          <td><?php echo $c->id;?></td>
          <td><?php echo $c->name;?></td>
          <td><?php echo $c->description;?></td>
          <td><?php echo $c->amount;?></td>
          <td>
            <div class="btn-group" data-toggle="buttons-radio">
              <button data-id='<?php echo $c->id;?>' type="button" class="enable btn btn-mini <?php if($c->status == 1) echo "active";?>">使用</button>
              <button data-id='<?php echo $c->id;?>' type="button" class="disable btn btn-mini <?php if($c->status == 0) echo "active";?>">禁用</button>
            </div>
          </td>
          <td><button data-id='<?php echo $c->id;?>' type='button' class='delete btn btn-mini btn-danger'>删除</button></td>
          <td><button data-id='<?php echo $c->id;?>' type='button' class='config btn btn-mini btn-primary'>设置</button></td>
          </tr>
        <?php endforeach;?>
        </tbody>
    </table>
  </div>
  <div id="push"></div>
</div>
<?php Asset::container('collection')->add('collection', 'js/backend/collection.js');?>
<?php echo View::make('backend.footer')->with('container', array('collection'));?>
